package com.mirror.frame.exception;

import com.mirror.llk.util.Interface;

/**
 * Service Exception
 * 
 * @author huzl
 * @version 1.0.0
 */
@SuppressWarnings("serial")
public class ServiceException extends RuntimeException {

    private String resultCode;

    private String resultMsg;

    public ServiceException() {
        super();
    }

    public ServiceException(String resultCode) {
        this.resultCode = resultCode;
        this.resultMsg = Interface.ERROR_MESSAGE.get(resultCode);
    }

    public ServiceException(String resultCode, String message) {
        super(message);
        this.resultCode = resultCode;
        this.resultMsg = message;
    }

    public ServiceException(String resultCode, String message, Throwable cause) {
        super(message, cause);
        this.resultCode = resultCode;
        this.resultMsg = message;
    }

    public ServiceException(Throwable cause, String resultCode) {
        super(Interface.ERROR_MESSAGE.get(resultCode), cause);
        this.resultCode = resultCode;
        this.resultMsg = Interface.ERROR_MESSAGE.get(resultCode);
    }

    public ServiceException(String message, Throwable cause) {
        super(message, cause);
    }

    public ServiceException(Throwable cause) {
        super(cause);
    }

    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    public String getResultMsg() {
        return resultMsg;
    }

    public void setResultMsg(String resultMsg) {
        this.resultMsg = resultMsg;
    }
}
